-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add type annotations to manim/_config/utils.py
#4230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add type annotations to manim/_config/utils.py
#4230
Conversation
eecabf9
to
4e2fb86
Compare
@JasonGrace2282 Would you take a look at this PR? |
# Conflicts: # manim/_config/utils.py
# Conflicts: # manim/_config/utils.py
5484d9e
to
3dd725d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me, thank you very much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon closer inspection (and actually due to our pre-commit mypy check): there now is an issue with the config.window_size
key typing that revealed a bug:
The OpenGLWindow does expect config.window_size
to be a string of shape 'width,height'
, or 'default'
. If one sets config.window_size = (900, 600)
or something like that (which is actually quite reasonable to assume, that an integer-tuple is a suitable choice), then the window crashes because it tries to call .split
on the config value.
Suggestion (up for discussion of course): we could rewrite the setter of config.window_size
to be tuple[int, int] | None
, with None
taking over the current role of 'default'
, and then simplify the logic in opengl_renderer_window.py
. Thoughts?
Since we merged PR #4363 which typed |
manim/_config/utils.py
I just saw @behackl comment. Before reading it, I already committed a fix 😅
Would that also make the getter of Actually, instead of having too much logic for validating and parsing EDIT: this should all probably be done in a follow-up PR |
Overview: What does this pull request change?
More work on #3375
Continuation of PR #4134
The module manim/_config/utils.py is now going through mypy checks without raising any issues.
Reviewer Checklist